<template>
  <div class="left_line com_echarts" id="left_line">
  </div>
</template>

<script>
import echarts from 'echarts';
import echartsrender from '../../../assets/js/jquery.echarts';
export default {
  name: 'left_line',
  data () {
    return {
        id:"left_line"
    }
  },
  created () {

  },
  mounted(){
      this.initchart();
  },
  methods:{
    initchart(){
        let that = this;
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById(this.id));
        var args={
            maxdata:120,
            xAxisdata: ['1月','2月','3月','4月','5月','6月','7月','8月'],
            series:[{
                name: '增长率',
                type: 'line',
                smooth: true,
                showSymbol: false,
                lineStyle: {
                    normal: {
                        width: 1
                    }
                },
                areaStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: 'rgba(31,234,251, 0.5)'
                        }, {
                            offset: 0.8,
                            color: 'rgba(31,234,251, 0)'
                        }], false),
                        shadowColor: 'rgba(0, 0, 0, 0.1)',
                        shadowBlur: 10
                    }
                },
                itemStyle: {
                    normal: {
                        color: '#1AEDFF'
                    }
                },
                data: [96.3,96.4,97.5,95.6,98.1,94.8,89.6,94.1]
            }]
        }
        var option = echartsrender.line(args);
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    }
  }
}
</script>
<style lang='scss'  rel="stylesheet/scss" scoped>
.com_echarts{
    width:100%;
    height:100%;
}
</style>
